/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package com.belencarrasco.orm;

import java.util.List;
import org.hibernate.criterion.DetachedCriteria;
import org.orm.PersistentSession;
import org.orm.criteria.*;

public class PedidoDetachedCriteria extends AbstractORMDetachedCriteria {
	public final IntegerExpression id_pedido;
	public final StringExpression mesa;
	public final StringExpression descripcion;
	public final IntegerExpression estado;
	
	public PedidoDetachedCriteria() {
		super(com.belencarrasco.orm.Pedido.class, com.belencarrasco.orm.PedidoCriteria.class);
		id_pedido = new IntegerExpression("id_pedido", this.getDetachedCriteria());
		mesa = new StringExpression("mesa", this.getDetachedCriteria());
		descripcion = new StringExpression("descripcion", this.getDetachedCriteria());
		estado = new IntegerExpression("estado", this.getDetachedCriteria());
	}
	
	public PedidoDetachedCriteria(DetachedCriteria aDetachedCriteria) {
		super(aDetachedCriteria, com.belencarrasco.orm.PedidoCriteria.class);
		id_pedido = new IntegerExpression("id_pedido", this.getDetachedCriteria());
		mesa = new StringExpression("mesa", this.getDetachedCriteria());
		descripcion = new StringExpression("descripcion", this.getDetachedCriteria());
		estado = new IntegerExpression("estado", this.getDetachedCriteria());
	}
	
	public Pedido uniquePedido(PersistentSession session) {
		return (Pedido) super.createExecutableCriteria(session).uniqueResult();
	}
	
	public Pedido[] listPedido(PersistentSession session) {
		List list = super.createExecutableCriteria(session).list();
		return (Pedido[]) list.toArray(new Pedido[list.size()]);
	}
}

